# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/5/11 10:25 上午
# @Author  : 白辉东
# @Mail    : masterbai2018@outlook.com
# @File    : adb_utils.py
# @Software: PyCharm

import os


def get_adb_sn():
    sn = ''
    buffer = os.popen('adb devices')
    for line in buffer:
        if '\tdevice' in line:
            sn = line.replace('\tdevice', '').strip()
    return sn


def get_adb_speaker_version():
    version = ''
    buffer = os.popen('adb shell cat version_usr')
    for line in buffer:
        version.join(line.strip())
    return version
